#!/bin/bash

if [ -d "${GCM_PATH}" ]; then
    url="http://localhost:6600/gcm"
    server_status_code=`curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} "$url"`
    if [ "$server_status_code" = "404" -o "$server_status_code" = "000" ]; then
        echo "0"; exit 0
    else
        echo "1"; exit 0
    fi
fi

